package com.hontech.libratest.conn

object DeviceConst {

    fun cargoTypeById(id: Int): String {
        return when (id) {
            0x00 -> "弹簧货道"
            0x01 -> "轨道货道"
            0x02 -> "挂钩货道"
            else -> "未知货道"
        }
    }

    fun progMsg(prog: Int): String {
        return when (prog) {
            0x00 -> "初始化"
            0x01 -> "打开防盗门"
            0x02 -> "升降至对应的行"
            0x03 -> "第一次出货"
            0x04 -> "第二次出货"
            0x05 -> "第三次出货"
            0x06 -> "升降归零"
            0x07 -> "关闭防盗门"
            0x08 -> "取物门打开"
            0x09 -> "取物门关闭"
            else -> "未知状态"
        }
    }

    fun msgWithCode(ec: Int): String {
        return when (ec) {
            0x00 -> "正常"
            0x01 -> "数据解析错误"
            0x02 -> "参数错误"
            0x03 -> "电机堵转"
            0x04 -> "电机超时"
            0x05 -> "货道错误"
            0x06 -> "轨道货道错误"
            0x07 -> "行错误"
            0x08 -> "列错误"
            0x09 -> "取货等待超时"
            0x0A -> "OTA ID无效"
            0x0B -> "OTA MD5校验失败"
            0x0C -> "温控器通信超时"
            0x0D -> "温控器数据异常"
            0x0E -> "数据桢头错误"
            0x0F -> "数据桢长度错误"
            0x10 -> "数据桢校验和错误"
            0x11 -> "数据桢尾错误"
            0x12 -> "OTA数据长度错误"
            0x13 -> "光栅被遮挡"
            0x14 -> "无法关闭取物门"
            0x15 -> "光栅检测不到"
            0x16 -> "推杆没打开"
            0x17 -> "货道不存在"
            0x18 -> "门打不开"
            0x19 -> "升降高度错误"
            else -> "未知错误"
        }
    }
}